﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tedds_Tool.Compilers.LEET;

namespace Tedds_Tool.Instructions.Actions
{
    public class ExpndColps : Action
    {
        public ExpndColps(String[] args) : base(args)
        {
        }

        protected internal override String MethodBody(AssertionSet asserts)
        {
            String pattern = "ExpandCollapsePattern";
            String action;
            if (args[3].Trim() == "Expanded")
                action = "Expand()";
            else
                action = "Collapse()";
            return MethodBody(pattern, action);
        }

        public override string PlainText()
        {
            if (args[3].Trim().EndsWith("Expand"))
                args[3] = "Expanded";
            else if (args[3].Trim().Equals("Collapse"))
                args[3] = "Collapsed";
            return "Target element " + args[2].Trim() + " " + args[3].Trim() + ".";
        }
    }
}
